package de.measite.smack;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;
import org.apache.harmony.javax.security.auth.callback.CallbackHandler;
import org.apache.harmony.javax.security.sasl.SaslClient;
import org.apache.harmony.javax.security.sasl.SaslException;
import org.apache.harmony.javax.security.sasl.SaslServer;
import org.apache.harmony.javax.security.sasl.SaslServerFactory;

public class Sasl
{
  private static final String CLIENTFACTORYSRV = "SaslClientFactory";
  private static final String SERVERFACTORYSRV = "SaslServerFactory";
  public static final String POLICY_NOPLAINTEXT = "javax.security.sasl.policy.noplaintext";
  public static final String POLICY_NOACTIVE = "javax.security.sasl.policy.noactive";
  public static final String POLICY_NODICTIONARY = "javax.security.sasl.policy.nodictionary";
  public static final String POLICY_NOANONYMOUS = "javax.security.sasl.policy.noanonymous";
  public static final String POLICY_FORWARD_SECRECY = "javax.security.sasl.policy.forward";
  public static final String POLICY_PASS_CREDENTIALS = "javax.security.sasl.policy.credentials";
  public static final String MAX_BUFFER = "javax.security.sasl.maxbuffer";
  public static final String RAW_SEND_SIZE = "javax.security.sasl.rawsendsize";
  public static final String REUSE = "javax.security.sasl.reuse";
  public static final String QOP = "javax.security.sasl.qop";
  public static final String STRENGTH = "javax.security.sasl.strength";
  public static final String SERVER_AUTH = "javax.security.sasl.server.authentication";

  public static Enumeration<SaslClientFactory> getSaslClientFactories()
  {
    Hashtable localHashtable = new Hashtable();
    localHashtable.put(new SaslClientFactory(), new Object());
    return localHashtable.keys();
  }

  public static Enumeration<SaslServerFactory> getSaslServerFactories()
  {
    return org.apache.harmony.javax.security.sasl.Sasl.getSaslServerFactories();
  }

  public static SaslServer createSaslServer(String paramString1, String paramString2, String paramString3, Map<String, ?> paramMap, CallbackHandler paramCallbackHandler)
    throws SaslException
  {
    return org.apache.harmony.javax.security.sasl.Sasl.createSaslServer(paramString1, paramString2, paramString3, paramMap, paramCallbackHandler);
  }

  public static SaslClient createSaslClient(String[] paramArrayOfString, String paramString1, String paramString2, String paramString3, Map<String, ?> paramMap, CallbackHandler paramCallbackHandler)
    throws SaslException
  {
    if (paramArrayOfString == null)
      throw new NullPointerException("auth.33");
    SaslClientFactory localSaslClientFactory = (SaslClientFactory)getSaslClientFactories().nextElement();
    String[] arrayOfString = localSaslClientFactory.getMechanismNames(null);
    int i = 0;
    if (arrayOfString != null)
      for (int j = 0; j < arrayOfString.length; j++)
        for (int k = 0; k < paramArrayOfString.length; k++)
          if (arrayOfString[j].equals(paramArrayOfString[k]))
          {
            i = 1;
            break;
          }
    if (i != 0)
      return localSaslClientFactory.createSaslClient(paramArrayOfString, paramString1, paramString2, paramString3, paramMap, paramCallbackHandler);
    return null;
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     de.measite.smack.Sasl
 * JD-Core Version:    0.6.1
 */